﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MongoExplorerTool.Infra.Connection;

namespace MongoExplorerTool.Infra.Tests.Connection
{
    [TestClass]
    public class ConnectionInfoTest
    {
        [TestMethod]
        public void IsValidComParametroServerInvalidoDeveRetornarFalse()
        {
            ConnectionInfo connectionInfo = new ConnectionInfo { Name = "Name", Password = "Password", Port = "Port", Server = string.Empty, Username = "Username"};
            Assert.IsFalse(connectionInfo.IsValid());
        }

        [TestMethod]
        public void IsValidComParametroNameInvalidoDeveRetornarFalse()
        {
            ConnectionInfo connectionInfo = new ConnectionInfo { Name = string.Empty, Password = "Password", Port = "Port", Server = "Server", Username = "Username"};
            Assert.IsFalse(connectionInfo.IsValid());
        }

        [TestMethod]
        public void IsValidComParametroServerENameValidosDeveRetornarTrue()
        {
            ConnectionInfo connectionInfo = new ConnectionInfo { Name = "Name", Password = "Password", Port = "Port", Server = "Server", Username = "Username" };
            Assert.IsTrue(connectionInfo.IsValid());
        }
    }
}
